#include <bits/stdc++.h>

using namespace std;

const int N = 1e5 + 10;
int  n , m , p;

int f[50005];

int find(int x){
    if(x != f[x])
    return f[x] = find(f[x]);
    return x;
}

void merge(int x, int y){
    int xx = find(x);
    int yy = find(y);
    if(xx != yy)f[xx] = yy;
}


int main()
{
    cin >> n >> m >> p;
    for(int i = 1; i<= n; i++)f[i] = i;
    for(int i = 1; i<= m; i++){
        int x , y; 
        cin >> x >> y;
        merge(x,y);
    }

    for(int i = 1; i <= p; i++){
        int p1,p2;
        cin >> p1 >> p2;
        if(find(p1) == find(p2))cout <<"Yes\n";
        else cout << "No\n";
    }

   
   return 0;
}
